<template>
  <div>
    <!-- <div>
      
<div v-for="el in tableData.listdata" :key="el.id">
    <img :src="proxy.$obj + el.img" />
    {{el.id}}
</div>

    </div> -->



    <el-table  :data="tableData.listdata.slice((currentPage4-1)*pageSize4,currentPage4*pageSize4)" style="width: 100%">
      <el-table-column prop="id" label="id" />
      <el-table-column prop="img" label="img" />
      <el-table-column prop="title" label="姓名" />
      <el-table-column prop="updata" label="科室" />
      <el-table-column prop="type" label="职位" />
      <el-table-column prop="type1" label="医院" />
      <el-table-column prop="type2" label="医院名" />
      <el-table-column prop="detail" label="详情" />
      <el-table-column prop="zhanghao" label="账号" />
      <el-table-column prop="mima" label="密码" />
      <el-table-column prop="pingjia" label="评价" />
      <el-table-column>
        <template #header>
          <el-input v-model="search" size="small" placeholder="请输入查询内容" @blur="searchLink"></el-input>
        </template>
      </el-table-column> 
     
    </el-table>
    <!-- 分页 -->
    <el-pagination
     v-model:currentPage="currentPage4"
      v-model:page-size="pageSize4"
      
      :current-page="currentPage4"
      layout="total, sizes, prev, pager, next, jumper"
      :total="tableData.listdata.length"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
  </div>
</template>
<script  setup>
  import { ref } from "vue";
  import {onMounted,getCurrentInstance,reactive} from "vue"
  // let arr=ref("")
  let tableData=reactive({
      listdata:[]
  })
let {proxy}=getCurrentInstance()
onMounted(async ()=>{		
  let res=await proxy.$axios('/homedata')
  console.log(res.data,proxy.$obj,11111111111)
      
      tableData.listdata=res.data
})

let searchLink=async ()=>{
  let res=await proxy.$axios.get('/homedata1',{params:{id:search.value}});
  console.log(res.data,proxy.$obj,2222222222222)
      
      tableData.listdata=res.data
}
  let search=ref("")
  const currentPage4 = ref(1);
  
  const pageSize4 = ref(15);
  const small = ref(false);
  const background = ref(false);
  const disabled = ref(false);
  
  const handleSizeChange = (val= number) => {
      pageSize4.value=val
  };
  const handleCurrentChange = (val=number) => {
      currentPage4.value=val
  };
  </script>


<!-- <script setup>
	import {onMounted,getCurrentInstance,reactive} from "vue"
    // let arr=ref("")
    let tableData=reactive({
        listdata:[]
    })
	let {proxy}=getCurrentInstance()
	onMounted(async ()=>{		
		let res=await proxy.$axios('/homedata')
		console.log(res.data,proxy.$obj,11111111111)
        
        tableData.listdata=res.data
	})

	
</script> -->


<style></style>